Repository navigation
fix: keep the local WSL gateway when winget uninstalls Companion - #2324
shanselman merged 4 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@RomneyDa a note on why this PR exists before #1955 has a maintainer decision. #1955 (P0, What changes, and what doesn't.
The tradeoff you would be accepting. This reverses behavior that Proof so far. Unsigned Dev builds of What I need from you.
|
|
Codex review: needs real behavior proof before merge. What this changesSilent Companion uninstall preserves the local WSL gateway unless the caller passes /RemoveLocalGateway=yes. Example: Run unins000.exe /SILENT with an eligible OpenClawGateway distro registered.
Review scores
ProductKind: Preference · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open: current main still selects destructive gateway cleanup during silent uninstall, and this focused change deserves an explicit owner decision about reversing that default. Priority: P0 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Inno uninstaller checks Store-migration preservation, selects whether gateway cleanup is authorized, and invokes the existing PowerShell helper before removing generated state. flowchart TD
A[Silent uninstall] --> B[Migration preservation checks]
B --> C[Preserve gateway]
B --> D[Read explicit removal switch]
D --> C
D --> E[Existing cleanup helper]
E --> F[Unregister WSL and clean generated state]
Technical reviewBest possible solution: Approve preservation by default with explicit unattended deletion in the existing uninstall owner, retaining all migration safeguards. Do we have a high-confidence way to reproduce the issue? Current-main source connects silent selection to WSL unregister, corroborated by the author's before/after Dev-installer output; this review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete implementation of the proposed safety policy: it changes the existing selection owner, updates its contract assertion and documentation, and preserves migration admission. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 558960df22b2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 18, 2026, 4:52 PM ET / 21:52 UTC. |
|
Hi, I'm a Copilot triage agent helping the maintainers land PRs (I'm not Scott). Here is runtime evidence for head Windows Sandbox red/green. I built this branch's installer with Inno Setup 6.7.4 using the v2026.11.3 payload.
Limits: this was an unsigned local build, and the guest has no WSL. It proves the uninstall decision path, not that a real distro survives. The guest also runs as an elevated admin. |
Uninstallers from v2026.11.3 and older, including the current WinGet package, still delete the local WSL gateway on a silent uninstall. Add that caveat and fix stale wording in wipe_openclaw_state.py and HARD-CLEAN.md. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Hi, Copilot triage agent here (not Scott). I pushed one small maintainer commit, fdc548c, with docs-only changes:
There are no code changes. Thanks again for the fix, @MertBasar0. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Hi, Copilot triage agent here (not Scott). One more small docs follow-up: a reviewer noticed the caveat missed the pre-releases published after v2026.11.3, which also remove the gateway on a silent uninstall. The wording now names v2026.11.3 (the current WinGet version) and pre-releases up to v2026.11.12-alpha.1, and the unattended example adds |
…comparison Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Hi, Copilot triage agent here (not Scott). I pushed a small follow-up (e79aabe):
|
Closes #1955
What Problem This Solves
winget uninstall, and any other silent uninstall, deletes the local WSL gateway without asking. The distro and everything in it are gone, while the README tells users they will be asked.User Impact
User impact: a silent uninstall now keeps the
OpenClawGatewaydistro and its generated state. An unattended caller who wants them removed passes/RemoveLocalGateway=yes.Behavior to review: this reverses the behavior
DEVELOPMENT.mddocumented on purpose. A script that relied on a silent uninstall to remove the gateway must add the switch. The interactive dialog and its No default, and the Store-migration preservation checks, are unchanged.Why This Change Was Made
EnsureLocalGatewayCleanupChoicealready explains why the dialog defaults to No: removal is destructive and unrecoverable. Its silent branch chose the destructive answer, and package managers uninstall silently by default (winget runs the entry'sQuietUninstallString,unins000.exe /SILENT, unless--interactiveis passed).#1955 asks for a maintainer decision. This PR implements option 1 there, which is also ClawSweeper's recommendation ("preserve by default, explicit removal switch, keep the migration safeguards"), so the change can be reviewed concretely. If option 2 (keep the behavior, document it) is preferred, this PR can be closed.
The switch is only read in the silent branch, after the existing migration checks. It cannot bypass them: a completed Store migration, an installed Store app, or an unavailable migration check still preserve the gateway.
Evidence
Unsigned Dev installers built with
scripts/build-inno-local.ps1 -Dev -Fastfrommain(558960df) and from this branch. Each case installs the Dev build, registers an empty throwawayOpenClawGateway-Devdistro withwsl --import, then runs the command named in the case and checks the registered distros.main558960df)QuietUninstallString,"<app>\unins000.exe" /SILENT(what winget runs)Silent uninstall: local gateway cleanup will run automatically.Silent uninstall: preserving the OpenClawGateway-Dev WSL distro and generated state. Pass /RemoveLocalGateway=yes to remove them.unins000.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /RemoveLocalGateway=yesSilent uninstall: /RemoveLocalGateway=yes requested local gateway cleanup.thenLocal gateway cleanup completed successfully.The installed release Companion and every other WSL distro were unchanged afterwards.
Change Type
Scope
winnodeRequired proof pools
windows-clean-installer-upgrade: the uninstall path changed. Not run here; it needs exact signed artifacts.Validation
Run on
main558960dfplus this change. Windows 11 x64 build 26200, tr-TR../build.ps1: succeeded.InstallerIssAssertionTests: 21/21 passed. Withmain'sinstaller.iss,Installer_RemovesGeneratedAppStateOnlyAfterGatewayCleanupfails (LocalGatewayCleanupRequested := Truefound).FileWorkerManifestTests.ManifestRejectsDirectAndDelayedSpeechRuntimeDependencies(… "VCRUNTIME140.dll"), which depends on this host's runtime install and is unrelated to the installer script.main558960dffails the same 39 tests (reparse-point and symbolic-link privilege, computer-name length, culture). One more test,GatewaySpeechTests.ActualGatewayRefusalsAreFiniteAndDoNotEchoResponseText, failed once on this branch and passed on rerun (20/20). CI on the PR head is the current-head result.Real Behavior Proof
main558960df, compared withmain558960df.wsl --importof an empty rootfs asOpenClawGateway-Dev, readQuietUninstallStringfrom the uninstall key and run it (or run the explicit removal command), wait for the uninstaller to finish, check the registered distros and the uninstall log./RemoveLocalGateway=yesit is removed.Yes/No/N/A): N/Awingetcommand itself. The Dev entry is not inwinget liston this host, and running it on the real package would remove the installed Companion. The cases run the exact command winget reads.windows-clean-installer-upgrade).Security Impact
No)Yes)No)No)No)Yes, explain the risk and mitigation: a silent uninstall now leaves the distro and generated state, including stored tokens, on disk. The uninstall log names them and the switch that removes them. The interactive No answer already leaves the same state.Compatibility and Migration
No)Yes)Yes)/RemoveLocalGateway=yesto any unattended uninstall that should remove the local gateway.Review Conversations